Skip to content

fix: add main field and relax peer dependency for plugin loading#15

Merged
mcmunder merged 4 commits into
mainfrom
fix/plugin-loading
Mar 18, 2026
Merged

fix: add main field and relax peer dependency for plugin loading#15
mcmunder merged 4 commits into
mainfrom
fix/plugin-loading

Conversation

@mcmunder

@mcmunder mcmunder commented Mar 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Added main field to package.json pointing to ./dist/index.js. All other working OpenCode plugins use main for entry point resolution — our plugin only had exports, which OpenCode's plugin loader may not resolve.
  • Relaxed peerDependencies from exact pin @opencode-ai/plugin: "1.2.27" to >=1.1.0, matching the convention used by other plugins.

Copilot AI review requested due to automatic review settings March 18, 2026 20:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves OpenCode plugin loading compatibility by adjusting the package entry point metadata and loosening SDK version constraints to better match how OpenCode resolves plugins.

Changes:

  • Add a main field pointing to ./dist/index.js to support loaders that don’t resolve exports.
  • Relax @opencode-ai/plugin peer dependency from an exact pin to a broader compatible range.
  • Add a Changesets entry to publish a patch release documenting the compatibility fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
package.json Adds main entrypoint and relaxes @opencode-ai/plugin peer dependency to improve plugin loader compatibility.
.changeset/fix-plugin-loading.md Documents the patch release and rationale for the loading/peer dependency adjustments.
Comments suppressed due to low confidence (1)

package.json:12

  • Since the goal is compatibility with loaders that may not honor exports, consider also adding a top-level types (or typings) field pointing to ./dist/index.d.ts. Otherwise, environments that fall back to main may resolve the JS entrypoint but fail to pick up the bundled TypeScript declarations.
  "type": "module",
  "main": "./dist/index.js",
  "exports": {
    ".": {
      "import": "./dist/index.js",
      "types": "./dist/index.d.ts"
    }
  },

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Copilot AI review requested due to automatic review settings March 18, 2026 20:33
@mcmunder mcmunder merged commit 3a7cff5 into main Mar 18, 2026
3 checks passed
@mcmunder mcmunder deleted the fix/plugin-loading branch March 18, 2026 20:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the package metadata for @mcmunder/opencode-git-memory to improve OpenCode plugin entry-point resolution and loosen version constraints for the OpenCode plugin API dependency.

Changes:

  • Add a main field pointing to ./dist/index.js to support loaders that rely on main instead of exports.
  • Relax @opencode-ai/plugin peerDependencies from an exact pin to a minimum version range.
  • Add a changeset to publish the update as a patch release.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
package.json Adds main entry point and relaxes @opencode-ai/plugin peer dependency range.
.changeset/open-symbols-exist.md Adds release note for the patch change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment on lines 48 to 50
"peerDependencies": {
"@opencode-ai/plugin": "1.2.27",
"@opencode-ai/plugin": "^1.1.0",
"typescript": "^5"
"@mcmunder/opencode-git-memory": patch
---

Add main field to package.json to hopefully fix plugin loading.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants